package ATM;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * 更改密码
 */
public class ChangePwdPanel extends JPanel {
    private JLabel oldPwd = new JLabel("输入原密码：");
    private JLabel newPwd1 = new JLabel("输入新密码：");
    private JLabel newPwd2 = new JLabel("再次输入新密码：");
    private JTextField oldPwdText = new JTextField();
    private JTextField newPwd1Text = new JTextField();
    private JTextField newPwd2Text = new JTextField();
    private JButton sureBtn = new JButton(new ImageIcon("src/ATM/image/buttonSure.jpg"));
    private JButton endBtn = new JButton(new ImageIcon("src/ATM/image/buttonOff.jpg"));
    private Font font = new Font("宋体", Font.BOLD,25);
    public ChangePwdPanel(ATMFrame atm){
        this.setLayout(null);
        this.setOpaque(false);

        oldPwd.setBounds(300,200,220,50);
        oldPwd.setFont(font);
        newPwd1.setBounds(300,300,220,50);
        newPwd1.setFont(font);
        newPwd2.setBounds(300,400,220,50);
        newPwd2.setFont(font);
        oldPwdText.setBounds(530,200,220,50);
        oldPwdText.setFont(font);
        newPwd1Text.setBounds(530,300,220,50);
        newPwd1Text.setFont(font);
        newPwd2Text.setBounds(530,400,220,50);
        newPwd2Text.setFont(font);
        sureBtn.setBounds(60,600,140,50);
        endBtn.setBounds(824,600,140,50);
        endBtn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                atm.showPanel("menu");
            }
        });

        this.add(oldPwd);
        this.add(newPwd1);
        this.add(newPwd2);
        this.add(oldPwdText);
        this.add(newPwd1Text);
        this.add(newPwd2Text);
        this.add(sureBtn);
        this.add(endBtn);


    }

}
